﻿<!--
//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - S+S Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================
-->

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:LitwareHR_Recruiting_Contract="clr-namespace:LitwareHR.Recruiting.Contract;assembly=LitwareHR.Recruiting.Contract"
	  xmlns:l="clr-namespace:LitwareHR.PublicApp.WinUX.Services"
    xmlns:c="clr-namespace:Ricciolo.Controls"
    xmlns:local="clr-namespace:LitwareHR.PublicApp.WinUX"
    x:Class="LitwareHR.PublicApp.WinUX.JobSearchView"
    >
        <UserControl.Resources>
        <Storyboard x:Key="OnLoadedTransition">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rootCanvas" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
       <DataTemplate x:Key ="CubeFace">
			<DataTemplate.Resources>
				<Style TargetType="TextBlock">
					<Setter Property="FontSize" Value="10"/>
					<Setter Property="HorizontalAlignment" Value="Center"/>
				</Style>
				<Style TargetType="Rectangle">
					<Setter Property="Width" Value="100" />
					<Setter Property="Height" Value="100" />
				</Style>
			</DataTemplate.Resources>
			<Canvas Tag="{Binding Title}" MouseDown ="Cube_MouseDown" Height ="100" Width ="100" Margin ="2">
				<Rectangle Height ="100" Width ="100" RenderTransformOrigin="0.5,0.5" Stroke="#FF506F8C" Canvas.Top ="0" Canvas.Left ="0" RadiusX ="10" RadiusY ="10">
					<Rectangle.RenderTransform>
						<TransformGroup>
							<ScaleTransform ScaleX="0.989" ScaleY="1"/>
							<SkewTransform AngleX="0" AngleY="0"/>
							<RotateTransform Angle="0"/>
							<TranslateTransform X="0" Y="0"/>
						</TransformGroup>
					</Rectangle.RenderTransform>
					<Rectangle.Fill>
						<LinearGradientBrush EndPoint="0.511,-0.073" StartPoint="0.489,1.073">
							<GradientStop Color="#FF7996B4" Offset="0"/>
							<GradientStop Color="#FF83A9CD" Offset="1"/>
						</LinearGradientBrush>
					</Rectangle.Fill>
				</Rectangle>
				<Image Canvas.Left ="32" Canvas.Top ="8" x:Name="rectImage" Source="{Binding Path=Image}" Width="41" Height="61"></Image>
				<TextBlock  Canvas.Top="50" Canvas.Left="5" Width ="90" Height ="25" Foreground="White" FontSize ="25" TextAlignment ="Center" TextWrapping ="Wrap" Text ="{Binding Count}"/>
				<TextBlock  Canvas.Left="1" Canvas.Top="75"  Width ="98" Height ="20" Foreground="White" FontSize ="15" TextAlignment ="Center" TextWrapping ="Wrap" Text ="{Binding Title}"/>
			</Canvas>
		</DataTemplate>

		<DataTemplate x:Key="cube">
			<ItemsControl ItemTemplate ="{StaticResource CubeFace}" Margin="0" ItemsSource="{Binding Path=Tag, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:Item3D}}}">
				<ItemsControl.Template>
					<ControlTemplate TargetType="ItemsControl">
						<ItemsPresenter/>
					</ControlTemplate>
				</ItemsControl.Template>
				<ItemsControl.ItemsPanel>
					<ItemsPanelTemplate>
						<WrapPanel  Background="{DynamicResource PageBackgroundBrush}"/>
					</ItemsPanelTemplate>
				</ItemsControl.ItemsPanel>
			</ItemsControl>
		</DataTemplate>

		<Style TargetType="{x:Type Rectangle}" x:Key="rectstyle">
			<Setter Property="Rectangle.Fill" Value="Green">
			</Setter>
		</Style>

		<Style x:Key="ListViewItemStyleBase" TargetType="{x:Type ListViewItem}">
			<Setter Property="BorderThickness" Value="1,1,1,1" />
			<Setter Property="BorderBrush" Value="#FF1D0F48" />
			<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
			<Setter Property="VerticalContentAlignment" Value="Stretch"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListViewItem}">
						<Border BorderBrush="{DynamicResource GridBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,5,5" Margin="0,0,0,0"  Width="330">
							<StackPanel>
								<GridViewRowPresenter Height="15" Width="330" />
							</StackPanel>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="LstVwItmStyle1" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewItemStyleBase}">
			<Setter Property="Background" Value="#FFEBEBEB" />
		</Style>
		<Style x:Key="LstVwItmStyle2" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewItemStyleBase}">
			<Setter Property="Background" Value="#FFC9D5E1" />
		</Style>
		<!---->
		<local:ListViewItemStyleSelector x:Key="ListViewItemStyleSelector" />

		<Style x:Key="headerStyle1" TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
						<Border  BorderThickness="2,2,0,2" CornerRadius="5,0,0,5" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
							<ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="headerStyle2" TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
						<Border  BorderThickness="0,2,0,2" CornerRadius="0,0,0,0" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
							<ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="headerStyle3" TargetType="{x:Type GridViewColumnHeader}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
						<Border  BorderThickness="0,2,2,2" CornerRadius="0,5,5,0" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
							<ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>


		<Storyboard x:Key="Expand">
			<DoubleAnimation Storyboard.TargetName="TopPanelBorder"
              Storyboard.TargetProperty="Width"
              From="330" To="765" Duration="0:0:0" />
			<DoubleAnimation Storyboard.TargetName="MiddleBorder"
              Storyboard.TargetProperty="Width"
              From="330" To="765" Duration="0:0:0" />
		</Storyboard>
		<Storyboard x:Key="Shrink">
			<DoubleAnimation Storyboard.TargetName="TopPanelBorder"
              Storyboard.TargetProperty="Width"
              From="765" To="330" Duration="0:0:0" />
			<DoubleAnimation Storyboard.TargetName="MiddleBorder"
              Storyboard.TargetProperty="Width"
              From="765" To="330" Duration="0:0:0" />
		</Storyboard>
		<VisualBrush x:Key="CubeReflectionBrush" Visual="{Binding ElementName=tab}"/>
	</UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource OnLoadedTransition}"/>
       </EventTrigger>
        </UserControl.Triggers>
	<Canvas x:Name ="rootCanvas" Width ="850" Height ="Auto" Background="{DynamicResource PageBackgroundBrush}">
		<Canvas x:Name ="CanvasCover" Width ="850" Height ="519" Background="{DynamicResource PageBackgroundBrush}">
		</Canvas>
		<Border x:Name ="TopPanelBorder" BorderBrush="{DynamicResource BorderBrush}" Width="330" Canvas.Top="20" Canvas.Left="20" BorderThickness="1" CornerRadius="0,10,0,0" Margin="0,5,5,0" Background="{DynamicResource BottomPanelBrush}">
			<DockPanel>
				<TextBlock Margin="5,2,5,2" Background="#00FFFFFF" FontSize="13" Foreground="#FFFFFFFF" Text="Job Search" DockPanel.Dock="Left" VerticalAlignment="Center"></TextBlock>
				<TextBox Name="txtJobSearch" Width="85" Margin="0,2,0,2" DockPanel.Dock="Left" VerticalAlignment="Center"></TextBox>
				<Button Name="btnSearch" Margin="0,2,10,2" Click="OnSearch_Click" Style="{DynamicResource ButtonSearchStyle}" Content="" DockPanel.Dock="Left" HorizontalAlignment="Left" VerticalAlignment="Center"></Button>
        <CheckBox x:Name="checkBoxDesktopSearch" IsChecked="True" Content="Desktop Search Enabled" Foreground="#FFFFFFFF" DockPanel.Dock="Left" VerticalAlignment="Center" HorizontalAlignment="Left"></CheckBox>
			</DockPanel>
		</Border>
		<Border x:Name="MiddleBorder" Canvas.Top="54" Canvas.Left="20" Width="330" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" CornerRadius="0,0,10,0" Margin="0,2,5,2" Background="{DynamicResource ContentAreaBrush}" Height="424">
		</Border>
		<TextBlock x:Name="tbDescription1" TextWrapping="Wrap" Margin="0,20,0,0" Foreground="{DynamicResource HeaderTextBrush}" Block.TextAlignment="Justify" Canvas.Top="55" Canvas.Left="40" Width="280">
			<Bold>LitwareHR</Bold> is a fictitious <Bold>HR</Bold> application providing recruitment-management
			software delivered as a service.
		</TextBlock>
		<TextBlock x:Name="tbDescription2" TextWrapping="Wrap" Margin="0,20,0,0" Foreground="{DynamicResource HeaderTextBrush}" Block.TextAlignment="Justify" Canvas.Top="100" Canvas.Left="40" Width="280">
			The most important aspect of this application is
			not what the application does, but how it does it. Using the latest Microsoft
			technologies such as .NET Framework 3.0 and SQL Server 2005, LitwareHR
			implements single-instance multi-tenancy patterns.
		</TextBlock>
		<Canvas x:Name="CanvasGrids">
			<Border Canvas.Top="70" Canvas.Left="40" BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,10,0,0" Background="{DynamicResource OutboxHeaderBrush}" Width="355" Height="20">
				<TextBlock Text="Open Positions" Foreground="{DynamicResource HeaderTextBrush}" Margin="5,3,0,0"/>
			</Border>
			<ScrollViewer x:Name="ScrollPos" Canvas.Top="92" Canvas.Left="40" Background="{DynamicResource GridBodyBrush}" Height="170" Width="355">
				<ListView Background ="{DynamicResource GridBrush}" x:Name="PositionView" ItemsSource ="{Binding}"  ItemContainerStyleSelector="{StaticResource ListViewItemStyleSelector}" Width="346">
					<ListView.View>
						<GridView>
							<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle1}" Header="Posted On" Width="112">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,2,0" Margin="0,0,0,0">
											<TextBlock Margin="1,0,0,0" Text="{Binding Path=PostedOn}" Width="112"/>
										</Border>
									</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>

							<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle2}" Header="Code" Width="112">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<Border  BorderBrush="{DynamicResource GridBrush}"  BorderThickness="0,0,0,0" Margin="0,0,0,0">
											<TextBlock Margin="1,0,0,0" Text="{Binding Path=Code}" Width="112"/>
										</Border>
									</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>

							<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle3}" Header="Title" Width="112">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="2,0,0,0" Margin="0,0,0,0">
											<TextBlock Margin="1,0,0,0" Text="{Binding Path=Title}" Width="112"/>
										</Border>
									</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>
						</GridView>
					</ListView.View>
				</ListView>
			</ScrollViewer>
			<Border Canvas.Top="273" Canvas.Left="40" BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,10,0,0" Background="{DynamicResource OutboxHeaderBrush}" Width="355" Height="20">
				<TextBlock Text="Desktop Search Results" Foreground="{DynamicResource HeaderTextBrush}" Margin="5,3,0,0"/>
			</Border>
			<ScrollViewer x:Name="ScrollWds" Canvas.Top="295" Canvas.Left="40" Background="{DynamicResource GridBodyBrush}" Height="170" Width="355">
				<ListView Background ="{DynamicResource GridBrush}" x:Name="WdsView" ItemsSource ="{Binding IsAsync=True}" VirtualizingStackPanel.IsVirtualizing="True"  ItemContainerStyleSelector="{StaticResource ListViewItemStyleSelector}" Width="346">
					<ListView.View>
						<GridView>
							<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle1}" Header="File Name" Width="112">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,2,0" Margin="0,0,0,0">
											<TextBlock Margin="1,0,0,0" Text="{Binding Path=FileName}" Width="112"/>
										</Border>
									</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>

							<GridViewColumn HeaderContainerStyle="{StaticResource headerStyle3}" Header="File Path" Width="224">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<Border  BorderBrush="{DynamicResource GridBrush}"  BorderThickness="0,0,0,0" Margin="0,0,0,0">
											<TextBlock Margin="1,0,0,0" Text="{Binding Path=FilePath}" Width="224"/>
										</Border>
									</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>
						</GridView>
					</ListView.View>
				</ListView>
			</ScrollViewer>
		</Canvas>
		<StackPanel Name="spSelectedImageNSmallCube" Canvas.Top="90" Canvas.Left="500" VerticalAlignment="Center"  HorizontalAlignment="Center">
			<!-- Selected Job Category Name -->
			<TextBlock Name="tbSelectedCategoryName" Foreground="{DynamicResource HeaderTextBrush}" FontSize="20" HorizontalAlignment="Center">
			</TextBlock>
			<!-- Selected Job Category Name Shadow -->
			<TextBlock Name="tbSelectedCategoryNameShadow" Foreground="{DynamicResource TextShadowBrush}" FontSize="20" HorizontalAlignment="Center">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1" ScaleY="-1"/>
						<SkewTransform AngleX="0" AngleY="0"/>
						<RotateTransform Angle="0"/>
						<TranslateTransform X="0" Y="20"/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<!-- Selected Job Category Image -->
			<Image Name="imgSelectedCategory" Width="75" Height="75" HorizontalAlignment="Center" Margin="0,0,0,10"></Image>
			<!-- Small Cube Start -->
			<Rectangle x:Name="CubeReflection"  Width ="200"  Height ="200" Fill ="{DynamicResource CubeReflectionBrush}" MouseDown="CubeReflection_MouseDown"/>
		</StackPanel>
		<!-- Cube -->
		<DockPanel Height ="Auto" x:Name="CubeCanvasDetails" Canvas.Left ="350" Margin="10,70,10,10" >
			<!-- Large Cube Start -->
			<c:Selector3D Width="315" Height="315" Margin="10,0,20,0" Padding="0" x:Name="tab" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True" ItemTemplate="{StaticResource cube}" Background="{x:Null}"/>

			<StackPanel x:Name="spPreviousNext" DockPanel.Dock="Left" HorizontalAlignment="Center"  VerticalAlignment="Center" >
				<!-- Button Next Start -->
				<Button x:Name="btnNext" Command="c:Selector3D.MoveBackCommand" CommandTarget="{Binding ElementName=tab}">
					<Button.Template>
						<ControlTemplate>
							<Image x:Name="PreviousImage" Source="../../Images/next.png" Width="50" Height="56"></Image>
							<ControlTemplate.Triggers>
								<Trigger Property="IsMouseOver" Value="true">
									<Setter TargetName="PreviousImage" Property="Width"  Value="60" />
									<Setter TargetName="PreviousImage" Property="Height"  Value="66" />
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Button.Template>
				</Button>
				<!-- Button Previous Start -->
				<Button x:Name="btnPrevious" Command="c:Selector3D.MoveNextCommand" CommandTarget="{Binding ElementName=tab}">
					<Button.Template>
						<ControlTemplate>
							<Image x:Name="NextImage" Source="../../Images/previous.png" Width="50" Height="56"></Image>
							<ControlTemplate.Triggers>
								<Trigger Property="IsMouseOver" Value="true">
									<Setter TargetName="NextImage" Property="Width"  Value="60" />
									<Setter TargetName="NextImage" Property="Height"  Value="66" />
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Button.Template>
				</Button>

			</StackPanel>
		</DockPanel>
		<!--Bottom Panel-->
		<StackPanel Canvas.Top ="479" Width ="770" Margin="20,0,20,0">
			<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,0,10,0" Margin="0,5,5,2" Background="{DynamicResource BottomPanelBrush}">
				<DockPanel Name="dpBottomPanel" FlowDirection="LeftToRight" Height="25">
					<Image x:Name="imgSchemaChanged" Source="../../Images/Alert.png" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="15,5,5,5" Height="16" Width="23" Visibility="Hidden"></Image>
					<TextBlock x:Name="tbSchemaChanged" Text="Schema Changed" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="5" Foreground="{DynamicResource HeaderTextBrush}" Visibility="Hidden"/>
					<TextBlock x:Name="tbSync" Text="Synchronizing" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,5,15,5" Foreground="{DynamicResource HeaderTextBrush}" Visibility="Hidden"/>
					<Image x:Name="imgSync" Source="../../Images/sync.png" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="5" Height="16" Width="23" HorizontalAlignment="Right" Visibility="Hidden">
						<Image.LayoutTransform>
							<RotateTransform CenterX="0.5" CenterY="0.5" />
						</Image.LayoutTransform>
					</Image>
				</DockPanel>
			</Border>
			<Border BorderBrush="{DynamicResource BorderBrush}" Name="BottomPanelShadow" CornerRadius ="0,10,0,0" Margin="0,0,5,5" Height="25" Background="{DynamicResource GridShadowBrush}"/>
		</StackPanel>
	</Canvas>
</UserControl>

